refactored logging support