cleaned up string manipulations