code clean up, fix some compiler warning