Refactor utils tests