minor code improvements. added test case for get sent stats