Moved macro parsing to separate function