move special code to template handlets