Added new logging, setting caching and cleanups