better class handling