updated code structure, added dns cache