Move context stuff into adapter, add namespace concept