Refactor ffserver