Breaking down active record queires