wip. refactorings, bug fixes, immutables template being migrated