refactor log