command serialization refactor + log