cleaned up the method creating the buttons
removed duplication from buttons