some more work on helper functions