Added constants, moved SQL connection logic to separate class