Refactoring conversion to dff