Add TEST_HARD mode
Refactoring