Refactor update_status()