Big refactor completed