Use const ref instead of const pointer