Refactor and re-structure the module layout