reorganise to allow use with sobpkg