Feature/external dereferencing

DO NOT MERGE! For review only!