Gem refactor