Code cleanup (more code cleanup coming.)