remove MAX macro usage