[minor] Optional middleware support