Use pointers instead of directly passing by value