migration script tuned up