Refactor static factories to config