Main module refactoring.