Refactored most of common.h into other files.