Refactored proxy factory not to inline encoding of certain types
merge