refactored elements to states, which are parameterized by space type