Changed how classes are retrieved

made use of the metadata factory methods to get entity classes - slims code down and is faster