refactored two lines to one line of code