Final refactoring done.