class upgrade, added support for domain specific middleware