factory refactor -> lambda