Introduce StackPHP & middlewares usage to improve code