Simplifying x^a*y^a to (x*y)^a



I have a idea (combined previous)

expcontract(_expr):=block([_z],
     exp_log_to_power(_e):= block([_s, logconcoeffp: lambda([_s],true)], 
logcontract(_e)),
     logexpand: super,
     scanmap(lambda([_z],if atom(_z) then _z else (
         exp_log_to_power(exp(logcontract(log(_z))))
     )),_expr)
)$

expr: x^a*y^a$
expcontract(expr);
  ->  (x*y)^a

expr: (a^d*b^d+c^a*a^a)/(d^b*e^b+a^b*c^b)$
expcontract(expr);
  -> ((a*b)^d+(a*c)^a)/((d*e)^b+(a*c)^b)

Derka