rename some method in java style and add constructor