Remove log and useless code