insert optimization and destroy timer when ranging service is destroyed

Signed-off-by: Andrea Corna <andrea.corna.ac.91@gmail.com>