client side refactoring. console stuff