middleware architecture