refactored this a bit more, implemented the command pattern