refactor - in test/unit replace grep and map use with more compact form