optimized drawing of GUI elements