Change the structure due to remove deprecated API