extract templates
reorg and refactor for now working base mobile version