rewrite test
refactor tests