small util function fixes
reuse functions