improve flow
Merge pull request #800 from tshepang/flow2

improve flow