Migrate my code in Smart API