refactoring SystemState for testing