Initial cleanup for massive refactor