refactoring and cleaning
lot of refactoring