Separated painting and update code.

Made a problem worse, but had to be done eventually.