better way to write out expiration logic