This is alternative implementation of activerecord