rearranged, renamed, cleanup