Added a more generic method for generating composite features.