Completed a bit of a refactor