simplifying and shrinking your code for better efficiency