refactor types