Refactor time formatter and ranking