Cleanup and improve as an example plugin