refines the select stmt