Shortening code based on review.