remove unused function
few small improvements