improve template structures, add archives, clean up functions, clean up markup