remove duplication between scripts, minor syntax consistency clean-up