Use a factory
refactor