refactored account renewal code