refactor userFactory, custom port for tests