changed image to code with me
refactored middleware to another file