Fix naming issues, make methods protected, make regex more flexible