made db migration code a little easier to understand