Some cleanup, update comments
Some refactoring in tests, added a TODO