Refactor command-specific functions into command.clj