Cleaned up middleware interfaces