more refactoring fun, moved commands into a command dispatcher