Added sanity check to retrieve
Complete overhaul. Now only exposes _safe_ functions