Sort template out