class overhaul

improved performance