Simplified code to just use an unless and not a ternary