proper usage of pointers and references for peers