Updated the logic following up the pattern mentioned in the attachment as when to use WAR envelop, ticket resolved.