light coding to like activerecord.