Move to factory pattern, unify handler names and template vars