Pass strings by reference instead of copying them everywhere