Refactor after checking tests