Improved named_scope for identifiers