using more references, less pointers