refactored logging class