logging changes + optimization of some stuff