Fix the script to use credpath passed, add some comments and TODOs