A Framework for Flexible Loads Aggregation