3 month old uncommited changes, refactoring mostly