has_many refactor