Changed how classes are retrieved

made use of the metadata factory methods to get entity classes