extract expiry cache to own type

Updates #5