refactoring and using docopt feature