refactor on logs