Refactor on migrations