Manage middleware dependencies by composing filters and handler factories