Moving factories to respective classes