Move empty/nil checking to the model