refactored duplicate success functions.