move db connection to helper.rb