dataplug: more refactor