Made an EntityRepository, improved some stuff