reduced 4 lines of code to 2 lines