Refactored more stuff into the painter.