Refactored to Gem Query