Removing success messages and cleaning up the code