moved util function to response