Various code cleanup
More code cleanups