restructure: define main module