Refactor some code into gather function and create tests