introduce state service for classes and events