Refactored draw logic