For maintainability and readability, the raw sql queries should be converted to sqlalchemy like queries.