Shorter/more readable variant suggested by @Geekfish