some renaming and rearranging