General-purpose gem template