Make middleware definition less complex