use more readable code and API to retrive data from Database