Code cleanup and fixed bug in Regex