Refactoring to separate XML inflating standalone and page/remote based