refactored to a state (money, command)