Refactor tests. Better coverage