core/util: code cleanup