On certain classes of finite groups