Add method to generate fields