Moved some middleware data back into main