Update and cleaning for new Max SDK