Fixed missing end
Refactoring of testing suite
merge