Decorator for commands, cleaned up some code