optimizing client example