Refactoring: removing dup code
Refactoring: XForms error removed