moved view elements to templates to create after ajax request