Energy reduction and flexibility in buildings under rehabilitation.