Formatting
Optimization and refactoring
Removed static
Fixed wrong input serialization