Refactor parameter passing by using a struct.