fixed test suite, other refactoring issue fixing