refactoring common types