Refactor in-game editor

Refactor games

Add toggle switch and refactor code