Add documentation and macros