Cleaning up the UI code. Aint this better now.