Change to use strdup

Makes code more readable.