fix small bugs in logs and began a factorisation