major refactoring
merge