more type refactoring