GUI cleanup
eliminating duplicate code