moved helper method to util class