extracting the ButtonListener