implementing either sync or async
Merge pull request #1 from doowb/refactor

implementing either sync or async