migrating the code