Refactor code to use Symfony OptionResolver component