Moving additional SQL query code into helper_sent.py

Small refactoring of some additional sent table SQL query code into the related helper module.