Slight refactoring
Merge remote-tracking branch 'yjwong/master'
Improved the whole command handling flow
Merge pull request #9 from xcchan/master

Improved command handling flow