Fix coding standard, remove deprecated code and fix variable names.