refactor funsets