Using namespace global state variable approach