Changes test's to cover more code and refactor some of them