add external profile stuff, remove obsolete code