extracted generation of null checks to outside render methods