Misc refactoring to clear up confusion