changed the Initialization and simplified it and added support for same path prefix but different pathVariables