add dependency generation & some code fix