Merge "Remove duplicate code and add fn for flag check" into main