Working out template rows