refactoring of active state