Complete rewritten plugin