made using middleware easier