moved parse to own function