Simplify some code in valueable_ad