Clean up code, simplify some things.