Major refactoring happening here.