rewrite ...
it's not easy to write it with callback way but not traditional programming style.