Refactoring tremendously