rewrite the factory entry point as a constexpr function