code of FR2 after refactoring, though still need to refacotr XMLGenerator and UploadToServer behaviour.