refactoring to create scala native flow construction syntax