Extract the gathering of the commits into own method