Rewrite of expiration handling