More renaming, attempt to replace domain specific functions with general functions and compositions.