added closure and better nodes compatibility