Fixed path output
Some refactoring, and better cli