middleware: code cleanup

The removed code doesn't serve anything.

Change-Id: I04b0cf7abc465de0115345018d2157da67f6985c
Merge "middleware: code cleanup"