fix memory leak
FunctionOfAny serialization
code style
Fix FunctionOfAny serialization
little refactoring