this ```if ... else``` is almost the same as above ... It can be placed in a helper function.