Move encoding helper to separate file
Move request and response classes to separate files