Question: separate subexpressions according to its variables

Hello, suppose I have an expression that consists of a multiplication of subexpressions involving only one variable, for example a_m(z) = a(m) * f(z) How can I retrieve a(m) and f(z) resp. separately? That is, I would like to be able to identify only those subexpressions involving that one variable in which I am interested. For instance, how can I retrieve a(m) from a_m(z)? I have tried using select( depends, op(factor(a_m(z))), m ), but is this bullet proof and/or is there a better solution? Thanks in advance, Regards, Franky.
Please Wait...