Removed duplicated and deprecated code.