stub for wharf script, also more refactoring for #12