Updated the Controller to use a map structure for the buttons.
Refactored some code.