refactor to reflect Arel better and minimize localized code