more robust style class handling