merge middleware functionality + update readme