moving retrieve_day function from trend to trend_daily model