refactored the code by creating a BTSqlManager class to handle all SQL code