Define plugin within immediately executed function