More test restructuration
Fix coding style and some refactoring
More code refactoring