Refactoring the my_traffic function...