Some rewriting of plugin