rearranged internal classes