shorten for-loops