Finished the refactor