Load modules and save them; rearranged code a bit