In recognition of the unmet need to develop novel therapeutic agents, the present invention discloses a novel class of heterocycles as dual inhibitors of BRD4 and class I PI3Ks. The compounds claimed herein could be used alone or in combination therapies for the effective treatment of a wide range of age-related diseases, including cancer. The present invention also provides methods for preparing compounds of the invention thereto.