Refactoring to move action listening to Gui