additional tests and some refactoring of `map()` calls with `for` loops