using only const references where possible