Added macros to make the code a bit cleaner