Refactoring and console logs