Added middleware framework