Finished refactoring and made need for abstraction clearer