Adding logs, Refactor