Refactoring + logs.