I would prefer this code to be in hooks.rb. Perhaps it might be easier to wrap it all up in a hash, like this: `stats = { :required => version.fixed_issues.release_notes_required.count, :done => ...}`?