functionalize and generalize