[Yujun] Fixed maven issue and removed duplicate code.