Added functon for buttons and extracted methods in GamePlayState