types refactor