Scenario manager code refactored