extracted some more code from the process repos method