Cache implementation from feature/cache branch