refactoring code - moving some functions to be methods of other classes. Remaining work on the simulate_command