refactoring - created util method