Migrated and updated the code