make base functions for collecting by trait and value