Fix of #67

Added expiration date to files
try to remove duplicate code