refactor log statements
refactor client