before refactor to a factory