Replicates some active record function