Change def to newcommand where possible