complete overhaul with template