refine logging
refactor the header file structure