if this code same as above reuse it as `parse_shared`