re organize and add console logs