Refactoring, going to wait until tomorrow to complete.