optimize sprite template