Cleaned up the string manipulation.