refactoring: toJSON -> messageToJSON
compile on Linux