* Refactored code a little
* It is possible to close WebSocket connection

Signed-off-by: Jiri Hnidek <jiri.hnidek@tul.cz>