Added `as` scope to member relations, and refactoring