Refactored commands into a class