added better handling of opts
added better style for opts
refactored cache expiry function in Options