refactoring console log