Major refactoring
Resolve conflict