Refactor rpg project