refactored painting tiles