refactor code structure for global utils