Refactor code ande delete console logs