Move docs and utility routines to right place