If these code may be reused by other rules, why not moving the code into utils ?
but letting them in this file is fine, I think.