Moving some more things into EntityFactory to clean up sloppy code.