refactor and create the entity-crud class