Converting functions to plugins