get_recent.py refactoring