ticket:92 refactoring and add logs