beginning of command pattern implementation to clean up horrid code