changes after code review: better regex pattern, more descriptive methods' names, more cases for unit tests