Cleaning up the code by using let values