some improvements for the ActiveRecordExtensions