Some restructuring and removed unused use statement