refactor of lessons distincts with caching