refactoring old code
merge