add pattern iterator and templateMethod