Refactoring some things for future functionality