Refactoring value assignment from one line conditional into two lines for improved readability