Finish refactor