moved closure to dependencies