Board generic unit tests

+ some refactoring