General review and refactoring.