Using pointers instead of copying the whole structures