Cleaned up regex code