Tiny code refactoring for loading middlewares
Update .gitignore