Cleanup

Just some code cleanup, no behavior changes. Could cause conflicts though, because I renamed some classes.