refactor common.h