Remove Unused code.
fix possible buffer overflow.
Code Cleanup.