move statevar to its own module
style fix
Add type checking for state vars