Move to a macro-based scheme for high performance