refactored utils module