sort base templates