Added templates for easier modulization.