Improve ad code