Shortening the code in various ways