getOrElse assures that the value will always exists and will never be None, 0 is a valid reference, when not set ref should always be None