Refactoring. Tuned caching a bit.
TODO: implement chunk watcher