Major refactoring
Clean up