refactoring – merge the two ifs

Before, there was one if clause for creating the button variable and another one for capturing the mouse click and assigning a "name". These two ifs have been merged, as the "if" and "else" match identical cases.