Refactored logic to avoid doubling up the logrotate config