Finalized refactor.