Start porting middleware