Refactoring db migrations