refactor type declarations