add Migrator test and refactor migrator to work with test