Replace custom exceptions with std::runtime_error