Some refactorings, safer regex