Implement new function and refactor.