improved dependencies and connection handling