added Tuning struct and cleaned up template