refactor zpool plugin