refactor class relationships