Factor out product and time selection - unfinished