Refactor screen rendering and cleaning