made database connection instance variable and removed static methods