More code refactoring, yay!