function reduction in queries.py + hawkey latest_per_arch adaptation