porting unsafe + imports