Moves build to public
Breaking regexes out of the loop