Refactor pig scripts to be independent of each other