Move the code to a plugin