Removed unused import
Removed method for debug printing
Refactored db connection handling
Changed method and variable names to be more descriptive