Refactored utils tests