Rework EntityDao and improve its readability