Passed some data by reference to improve performance