Removed unused code.
Painting code cleanup.