fixed unused and deprecated code