Refactored get_last_totalcount for more efficiency