cleaning up select row code