Rename shfnc file; reorder some code