Added err and file logger
Improved cluster type detection