Refactoring. Decoding optimization. Websocket encoding optimization. #123