Refactoring and tidying.