tried to make everything a factory, but it seems that is not the way to go