Improved parser so its uses a regex and less lines of code. Easier to read and understand.