more refactoring

changed around some more names + bit of the logic.
Fixed couple of smallish bugs.
small bugfix