Refactor all unit tests