tidy up controller for user command dispatching to functions