Proper deps handling. UNTESTED!