added singleton and initialize regexes, refactored method def regex