slight cleanup of helper functions