Refactoring by making use of Palette/PaletteButton classes