refactor and show success messages