Log: simplify code