Refac unit tests