Implementing optimization only for III and IV classes