Removing activerecord dependency