Recreation of essential methods from ActiveRecord