Minor refactor of ajax success functions and improvement to display of message.