Refactoring and db feature extraction added
db handling