refactoring and log removed