add plugin and util interface + quick refactor