That's great. Move the code to a module to make the model cleaner.