factory method implementation thanks to geoff