connection correction
utility functions and constants cleanup