fix code style. Switch functions to drush API.