less hacky factory method