Plugin rewrite for better pattern use