Rearranged buttons, code cleanup