Refactored to use std::string instead of C-style strings