removing active_record dependency