Checkpoint
Some refactoring mostly completed