Refactor mac.h [not done]