some simplifications, add cache location to output