small util method refactoring