refactoring. extract feature dict to global variable to decrease the parameters of each functions