refactored away the console logs