Refactoring log messages and optimize imports