refactor setStage, ready for implementation