add unless defined for DB constant, change app-wide variables to constants