Made MessageFactory classes non-static, reduced reference leakage in constructors.