add patterns routes and macro activeStates