Split main into module files.