up recent message count
fix missing upgrade duration value
add todo items
reuse distance on rlhelper
move direction() to rlhelper