setup improved with templates