Refactored the code to isolate the string handling. Fixed return values to use SUCCESS and FAILURE.