Moved the state variable to the module's local context