Class code improved