replace dropdown with select. optimize the select code