improve flow
Merge pull request #801 from tshepang/flow

improve flow (some more)