removed obsolete class and use entities the proper way