pull out oracle functions
clean up