implemented auto creating instances from factories