General refactoring.