refactoring
fix tests