Refactor client attribute fetching and logging