Refactor: separates a big alter_tables method
Refactor: reduce the last lines in blocks by using .each_with_object method