Shortened Code

xyzz's suggestion to shorten the code