simplyfied the anon and complx pattern generation