Refine build cycle, use correct dependencies and shade dependencies.