Fix #1840 : Refactor last_seen_complete code