move some generic gadgets to the Flow project