Updated to use conditional assignment, instead if checking for .nil? condition