Make remaneepisode and episodeexists local functions.
Use local functions, and import functions from seriescache.