Ideally this could move to the util class. In case some one else wants to use this method.