organize the command (and now works like https://gist.github.com/kazuho/9800525)