Added statemachine and singeton from NGJ