remove dead code, refactoring
fix tests and invalid generation
rename test file