refactored for simple logger