refinement: extract dep code.