remove unused code
improve log command