refactored ScreenTemplateFactory, removed single view selection and cleaned memory leaks