has_many through refactoring