make dependency checking generic