Complete refactor.