Extract common header and variable to header file