Migrational Typing and its Applications