Pretty much finished with the refactor