refactor tests, add regression