moving some routines to private context