Massive code cleanup
Conflict resolving...