Reorganize gets_x logic