[refac] extract function to split factors by type