refactor of main module layout