use map to shorten block