add logging, minor improvements
minor utility work