write the same parser functionality a more easy to read way