Refactor for making symfony 2 demo app working