Extract saving of main module to utils.
Add frame utils.
Remove unused field.