Methods added for select and text code simplified