Restructured float_selector's code