Refactoring code in DFABuilderView