refactor scripts
fixes #1