initializing cli.App and passing arguments to parser
using log module
cleanup and fixed code structure