Changed class support and added cleanup stuff