refactor to make script more generic; add usage instructions (JBIDE-13600)