begin refacto, add entity class manager etc