removing RMySQL code from models