bug fixes + abstraction of sending notification