Many Changes, mostly refactoring