delete unused function
fix a leaking socket on mono plus simplify