refactored the logger completely.