Refactor GemParser class