swing code clean up