logic isolated into small methods, xml templates have their own file