Can Mathematica factor out constrained functions when it simplifies?

For example, distributions in the exponential family take a likelihood function of the form $ $ f(x)g(\theta)e^{\phi(\theta)^{T}u(x)}$ $ . Given some ugly algebraic expression, can I tell mathematica to infer $ $ f(x),g(\theta),\phi(\theta),u(x)$ $ To say, show my ugly algebraic expression can be factored into that constrained form? I cannot find any documentation on this subject