avoid unnecessary local before return
rm deprecated code