views factorization + db connections