refactored painting code