Cleaning code from actionPerformed