Move utility functions into separate module
Add websocket notifications