Implementation of parameterized factory method