Removed unecesary macro and inlined the logic.