Performance refactor.