Code cleanup, no user visible changes (hopefully)