improve logger & add some logs & code cleanup