Code tidy & refactor.