Remove warnings and deprecated code