Switch to non deprecated methods in AutoCommand

Not convinced I like it.