started improving tests and big refactoring
continuing...
green at least...