finished refactoring and logging