Refactors a bit, adds notification