simplify class handling. support ajax data