minor fix
refactoring
more tests