Refactored draw code to layer graphic elements