Reorganizing function implementations in select