refactor fetchdog to be activerecord