State template generator