Better style in Template#mime and Template#detect