few enhancments and cleanups