refactoring the utils module