split main() to look nicer, fix some todos in moduleMAin