a bit of refactoring, removed EpgEntry from some functions.