Updated code to Symfony 2 standard