Refactor lookup command and partially fixed #72.
Merge pull request #77 from piotrooo/master

Refactor lookup command and partially fixed #72.