Refactor GEM structure