Clean up function parameters, move some unnecessary parameters to private class properties