fix some warnings and remove redundant or no longer used code
fix merge