version counter and refactored logging