cleaned up code a bit and fixed an error on the connection provider