cleaning templates and other small fixes