move the utility method in a separate file