convert named_scope in lib/ as well