fixed tests and added tests and extracted regex a bit