move dependency verification into function