Put parser into seperate function