convert to use of entity obj