More cleanup

See commits for details.