refactoring and add some types