remove unused code and tidy up notification