extract code into raphhh/puppy-front-controller