Added xml templates, also improved the flow.