refactor the script interface a bit