Removed unused debugging and renamed middleware