Internal density functional theory of molecular systems