sorting everything into templates, currently very rough