handlers and base template