Updating code to make  more readable