Setup buttons and organize code