Clean up code, add beter verbose, add disconnect handler