WIP: script helper functions