refactor "badly formatted arguments" to helper function