Refactor the anonymous flag setting class