structure change and some tests

structure changes;
log format changes;
partial tests