Reversed the design, and break dependency CMS_SETUP => CMS_API . Now CMS_API has attribute setup: CMS_SETUP . Moved error_handler from CMS_SETUP to CMS_API. The instance of CMS_SETUP is used when instanciating modules. The instance of CMS_API is used when instanciating CMS_REPONSE and Handlers/Filters. The instance of CMS_API is passed as argument to build the CMS_MODULE.router and filter.