Replace module level factory functions with type constructors