cleaned up ui code