parent() should return ref
re-organize client library, refactoring