Adding the logic for generating classes