Refactoring to symfony2