Change constructor to pass string input by ref.