refactoring tests and avoid doing it twice.
Merge remote-tracking branch 'origin/79_refactoring_tests' into dev