refactored more of the draw function into simpler helper functions