Move dependency creation and cleaned up logging Reviewed-by: hseigel, jiangli
Reviewed-by: darcy, ihse