Clean-up and refactor.