update to use static SQL functions