use Silex and refactor