refactor rpg project