added pg and rails_factor