simplify regex parsing
better to throw exceptions for errors
simplify