finished some restructuring