big cleanup, sort things between display class and main loop